<%-- 
    Document   : addExternalReview
    Created on : 7-apr-2013, 17.29.51
    Author     : Luca
--%>

<%@page import="ejb.ArticoloUsato"%>
<%@page import="ejb.Videogame"%>
<%@page import="java.util.List"%>
<%@page import="ejb.Piattaforma"%>
<%@page import="java.util.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="wrapper.jsp" %>
<style type="text/css">
.aggiungi {
width: 85px;
float: left;
padding-top: 5px;
text-align: right;
}
</style>
<%
    Utente utSession = (Utente)session.getAttribute("utente");
    String tipo = utSession.getTipo();
    List<ArticoloUsato> usatiDaConfermare= (List<ArticoloUsato>)session.getAttribute("usatiDaConfermare");
%>

<div class="container">
   <div class="row-fluid">
        <div class="span3 bs-docs-sidebar">
            <ul class="nav nav-list bs-docs-sidenav">
                <li><a href="Controller?button=aggiungiRecensioneInternaAus"> 
                <button class="btn btn-large btn-inverse btn-block" style="width:210px"><i class="icon-white icon-plus"></i> Aggiungi Rec. Interna</button> </a></li>
                <li><a href="Controller?button=visualizzaRecensioniInterne"> 
                <button class="btn btn-large btn-inverse btn-block" style="width:210px"><i class="icon-white icon-th-list"></i> Recensioni Interne</button> </a></li>
                <li><a href="Controller?button=visualizzaRecensioniEsterne"> 
                <button class="btn btn-large btn-inverse btn-block" style="width:210px"><i class="icon-white icon-th-list"></i> Recensioni Esterne</button> </a></li>
            </ul>
        </div>   

<div class="span6">   
    <h3>Aggiungi Recensione Esterna</h3>        
<form class="form-horizontal" action="Controller" method="POST" onSubmit="return checkExternal(this)">
    
	
    <div class="control-group">
        <%
        List<Videogame> videogiochi=(List<Videogame>)request.getAttribute("listVideogiochi"); 
        %>

    
      <div class="control-group">
    <label class="control-label" for="inputPiattaforma">Videogiochi:</label>
      <div class="controls" id="videogiochi">
      <select name="videogiochi" id="Select1" size="4" multiple="multiple">
          <% for (Videogame v:videogiochi){
              out.println("<option value=\""+v.getNomeEPiattaforma()+"\">"+v.getNomeEPiattaforma()+"</option>");
          }
          %>
      </select>
    </div>
    
    </div>
    
    <div class="control-group">
    <label class="control-label" for="inputUrl">Url:</label>
    <div class="controls">
    <input name="url" type="text" id="inputUrl" placeholder="Percorso recensione"  >  
    </div>
    </div>

    <div class="control-group">
    <label class="control-label" for="inputVoto">Voto:</label>
    <div class="controls">
    <input name="voto" type="text" id="inputVoto" placeholder="voto">
    </div>
    </div>
    <div class="control-group">
    <label class="control-label" for="inputScala">Scala:</label>
    <div class="controls">
    <input name="scala" type="text" id="inputScala" placeholder="scala">
    </div>
    </div>
       <label id="erroreDati" style="padding-left: 180px;color: red;"></label>
    <div class="control-group">
        
    <label class="control-label" style="padding-left: 180px"><button  class="btn btn-small btn-inverse btn-success" type="submit" value="aggiungiRecensioneEsterna" name="button"><i class="icon-white icon-ok"></i> Aggiungi Recensione</button></label>
    </div>
 </form>
</div>
<div class="span3">
    <% if(tipo.equals("a")){%>
    <div class="thumbnail">
                 <p><b>Notes</b></p>
                 <br>
                 <% if(!usatiDaConfermare.isEmpty()){%>
                    <p> Ancora <%=usatiDaConfermare.size()%> articoli da confermare </p>
                    <br>
                    <p align="center">
                        <a href="Controller?button=modificaCancellaArtUsati&amp;confirm=s">
                            <button class="btn btn-inverse btn-small"><i class="icon-white icon-th-list"></i> Vedi Articoli da confermare</button>
                        </a>
                    </p>
                 <%}else{%>
                 <p> Nessun articolo da confermare </p>
                <%}%>      
            </div>
      <%}%>   
      </div>          
   </div>
</div>
</div>
</body>